HIOKI3154/HP34401A Instrument communication driver

 

HIOKI3154/HP34401A Instrument communication driver is the driver to communicate with communication HIOKI 3154 Digital M¥Ø Hi Tester controller of HP in U.S.A.

 

1. Read Settings

 

<Figure 1> is read setting example of HIOKI3154/HP34401A Instrument communication driver.

<Figure 1>  Read setting example of HIOKI3154/HP34401A Instrument communication driver

Device part of  <Figure 1> input Com Port(COM1), Baud Rate(9600), Parity Bit(0), Data Bit(8), Stop Bit(1) respectively, according to setting of controller.

Also you can input weather to save 'the readed value saving to String memory'(1 : save, 0 : don't save, default = 1), 'start data saving address of interlal memory'(0 ~ 9999, default = 0), 'number of data saving'(default = 200) by using option part.

 

HIOKI3154/HP34401A Instrument communication driver read schedule

HIOKI3154/HP34401A Instrument communication driver input 'READ' one line for read schedule.

 

Read schedule example)

READ,

 

HIOKI3154/HP34401A Instrument driver communicate ASCII type and can read controller's operation status.

HIOKI3154/HP34401A Instrument communication driver save readed data as follows.

If you click the icon  in protocol option part, you can see the dialogue box such as <Figure 2>. you can also set the readed value saving parameters by using this part.

<Figure 2> Example of  HIOKI3154/HP34401A Instrument communication driver¡¯s Option dialogue box

 

Read Ok status and readed data

<Table 1>, <Table 2> are data saving address and contents of read Ok status value, readed data.

 

Contents Data Saving Address Remakrs
Read status(Ok = 1) Input address when write setting + 0  WORD, DWORD, FLOAT memory always blank at String memory
Readed number data value Input address when write setting + 1  WORD, DWORD, FLOAT memory
<Table 1> Data saving address and contents of read Ok status value
Contents Data Saving Address Remakrs
1st data Input address when write setting + 2 
WORD, DWORD, FLOAT memory
save string data separated by comma( , ) at String memory
¡¦ ¡¦
<Table 2> Data saving address and contents for readed data

Memory value setting method of 'Communication server') Setting parameters of Digital/Analog output tag :  Extra1 =  #mem# , Address = address of internal memory, Output value = writing value(0 : Off, 1 : On, ... )

 

2. Writing settings

You can control or setting the HIOKI3154/HP34401A Instrument by using write settings.

 

Digital Write

Digital write setting parameters are as follows:

1)  PORT                   Port no. (0 ~ 255)

2)  STATION              Don't care.

3)  ADDRESS           Readed data saving address(decimal unit).

4)  Extra1                   Write command = HIOKI3154/HP34401A instrument control or setting command. ( refer to HIOKI3154/HP34401A reference manual )

5)  Extra2                   Don't care.

 

Write example 1)

PORT:0,  station:0, ADDRESS:0300, Extra1:*CLS,  Extra2 :

The setting parameter shown above is error status clear example of HIOKI3154 controller.

 

Write example 2)

PORT:0,  station:0, ADDRESS:0300, Extra1:TIMer?,  Extra2 :

The setting parameter shown above is 'Timer value read' request example. After reading the Timer data, save the readed value to 300 ~ 302, ... WORD, FLOAT, DWORD memory.

( 300 Address : Read Ok status – 0 = read error(don't read data), 1 = read Ok,

301 Address : number of data – 0 = don't exist data, 1 ~ n = 1 ~ n number of data,

302 Address : 1st readed value of number data, ¡¦. )

 

Write example 3)

PORT:0,  station:0, ADDRESS:0310, Extra1:DELay?,  Extra2 :

The setting parameter shown above is 'Delay value read' request example. After reading the Delay data, save the readed value to 310 ~ 312, ... WORD, FLOAT, DWORD memory.

(310 Address : Read Ok status – 0 = read error(don't read data), 1 = read Ok,

311 Address : number of data – 0 = don't exist data, 1 ~ n = 1 ~ n number of data,

312 Address : 1st readed value of number data, ¡¦. )

 

Write example of HP34401A Multi Meter)

Write example 1)

PORT:0,  station:0, ADDRESS:0300, Extra1:*CLS,  Extra2 :

The setting parameter shown above is error status clear example of HP34401A Multi Meter controller.

 

Write example 2)

PORT:0,  station:0, ADDRESS:0300, Extra1: FUNC ¡°VOLT:DC¡±,  Extra2 :

The setting parameter shown above is a changing example for VOLT DC measurement mode of HP34401A Multi Meter controller.

 

Write example 3)

PORT:0,  station:0, ADDRESS:0300, Extra1: FUNC ¡°VOLT:AC",  Extra2 :

The setting parameter shown above is a changing example for VOLT AC measurement mode of HP34401A Multi Meter controller.

 

Write example 4)

PORT:0,  station:0, ADDRESS:0300, Extra1: INIT,  Extra2 :

The setting parameter shown above is reading data initialization(reading start) example of HP34401A Multi Meter controller.

 

Write example 5)

PORT:0,  station:0, ADDRESS:0310, Extra1: FETCH?,  Extra2 :

The setting parameter shown above is 'Saved measurenent data read' request example. After reading the data, save the readed value to 310 ~ 312, ... WORD, FLOAT, DWORD memory.

( After INIT command, number of readed for setting trigger time perild : max 512 measurement data stored to HP34401A Multi Meter )

 

(310 Address : Read Ok status – 0 = read error(don't read data), 1 = read Ok,

311 Address : number of data – 0 = don't exist data, 1 ~ n = 1 ~ n number of data,

312 Address : 1st readed value of number data, ¡¦. )

 

Analog Write

Analog write and digital write have the same setting parameters except output value. 

 

3. Terminal screen example for HIOKI3154/HP34401A Instrument communication driver

Terminal screen example of HIOKI3154/HP34401A Instrument communication driver at SCADA SCADA Server are as follows.

For use terminal screen, you have to save 'the readed value saving to String memory' at the option part.

a) Make 20 String tag String and Edit box at Studio.

b) Make digital output tag for writing command at Studil such <Figure 3>. 

<Figure 3> Example of terminal screen at Stuido program

c) Make script at  botton from <Figure 3> in order to see previous command.

 

Function

Contents

to see previous command at terminal screen

if(pos == $scroll_pos) return;

pos = $scroll_pos;

 

for(i = 0; i < 20; i = i+1) {

   @sprintf(tag_name, "ST_%02d.address", i);

   @SetTagValue(tag_name, pos+i);

}

<Table 3> Script example for previous command at terminal screen

 d) Please check( v ) and select 'Key Down' at Expand tab at Edit box such as <Figure 3>. Then, <Figure 4> will be opened.

e) At <Figure 4>, please make Key Down script such as <Table 4>.

f) Also, select tag that store the contents of Edit box at Tag tab.( example : STRING02 )

g) <Figure 5> is terminal screen example at SCADA Server.

<Figure 4> Example of Expand tab at Edit box

 

Function Contents

script example when pressing 'enter' key

retn = @KeyGetCode();

if(retn != 13) return;    // don't 'enter' key return

                                 // copy to Extra1 parameter, input string

@sprintf($DO_EXEC.Extra1, $STRING02);

$DO_EXEC = 0;        // write command

@EditBoxSetText("EditBox1", "");

<Table 4> Script example when pressing 'enter' key
<Figure 5> Terminal screen example at SCADA Server